package com.lzy.chat.c_service.Exception;

public enum Exceptions {
    //User异常
    UserInsertException(1000, "用户信息插入异常"),
    UserNotFoundException(1001, "用户不存在"),
    UserUpdateException(1002, "用户更新异常"),
    UserPasswordNotMatchException(1003, "用户密码错误"),
    //Friend异常
    FriendDeleteException(2000, "好友删除异常"),
    FriendDuplicatedException(2001, "好友重复添加"),
    FriendInsertException(2002, "好友关系插入异常"),
    FriendNotFoundException(2003, "好友未找到"),
    FriendCanNotAddSelf(2004, "不能添加自己为好友"),
    //Message异常
    MessageInsertException(3000, "消息插入异常"),
    MessageUpdateException(3001, "消息更新异常"),
    //Group异常
    GroupDeleteException(4000, "群组删除异常"),
    GroupInsertException(4001, "群组插入异常"),
    GroupNotFoundException(4002, "群组未找到"),
    GroupUpdateException(4003, "群组更新异常"),
    GroupPermissionException(4004, "群组权限异常"),
    GroupDuplicateException(4005, "已经在此群中"),
    GroupNotAllowedJoin(4006, "该群不允许加入"),
    AddGroupInsertException(4100, "群申请插入失败"),
    AddGroupUpdateException(4101, "群申请更新失败"),
    AddGroupDuplicateException(4102, "重复申请"),
    //Token异常
    TokenDecodeException(5000, "token解码异常"),
    TokenNotFoundException(5001, "未找到token"),
    TokenVerifyException(5002, "token验证异常"),
    //File异常
    FileEmptyException(6000, "文件为空异常"),
    //AddFriend异常
    AddFriendInsertException(7000, "添加好友请求异常"),
    AddFriendUpdateException(7001, "添加好友请求更新异常"),
    AddFriendDuplicateException(7002, "重复发送好友请求"),

    //验证码发送异常
    SendCodeException(8000, "验证码发送异常"),
    SendEmailException(8001, "验证邮箱异常"),
    SendPhoneException(8002, "验证手机号异常"),
    EmailException(8003, "邮箱已被注册"),
    PhoneException(8004, "手机号已被注册"),
    ;

    private final Integer code;
    private final String message;

    Exceptions(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}
